#pragma once
#include "AbstractConf.h"
#include "XmlDocument.h"

class HTTPConfig :
	public AbstractConf
{
public:

	~HTTPConfig();

	static HTTPConfig * getInstance(const std::string &);


	/*设置配置文件名称*/
	void setConfigFile(const std::string & str);

	/*获取端口*/

	unsigned int getPort();

	/*获取ip*/

	std::string getIP();

	/*是否开启目录浏览*/

	bool isDocVisible();

	/*获取web目录*/

	std::string getWebPath();

	std::string getTmpRoot();

	/*获取最大连接数*/

	unsigned int getMaxConnect();

	unsigned int getMaxConnectionsPerIpNumber();

	bool load();

	/*获取超时时间*/

	unsigned int getTimeout();

	/*销毁实例*/
	static void DestroyInstance();

	std::string get(const std::string &);


	 unsigned long  getMaxConnectionSpeed();

	 unsigned long  getSessionTimeout();
	 
	 unsigned long  getRecvTimeout();
	 
	 unsigned long  getSendTimeout();
	 
	 unsigned long  getKeepAliveTimeout();

protected:
	HTTPConfig(std::string & str);
	HTTPConfig();
private:
	XMLDocument *xmlDoc;

	XMLHANDLE xmlHandle;

	HTTPConfig(const HTTPConfig &);

	HTTPConfig & operator = (const HTTPConfig &);

	/*配置项*/
	std::string configFile;

	/*静态对象*/
	static HTTPConfig * m_instance;
};


